package com.xsky.converter;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import com.thoughtworks.xstream.converters.basic.DateConverter;

public class TimeStampConverter extends DateConverter {
	
	private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
	private static final String[] DATE_FORMATS = {DATE_FORMAT,"yyyy-MM-dd"};
	
	private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
	public TimeStampConverter() {
		super(DATE_FORMAT, DATE_FORMATS);
		
		// TODO Auto-generated constructor stub
	}

	public boolean canConvert(Class clazz) {
		return clazz==Timestamp.class||Timestamp.class.isAssignableFrom(clazz);
	}

}
